package main.java.design.factory;

/**
 * <p>
 *     工厂方法模式
 * </p>
 *
 * @author : wangdejian
 * @version 1.0
 * @date : 2020/6/9 21:23
 */
public class TestFactory {

    public static void main(String[] args) {
        Factory circleFactory = new CircleFactory();
        Shape circleShape = circleFactory.productShape();
        circleShape.draw(); // Circle::draw() method.

        Factory squareFactory = new SquareFactory();
        Shape squareShape = squareFactory.productShape();
        squareShape.draw(); // Square::draw() method.

    }

}
